﻿using System;
using System.Collections.Generic;
using System.Text;

using MVPlan.Engine.Segment;

namespace MVPlan.Engine.Dive
{
    public enum WarningType
    {
        NotSet,
        PPO2High,
        PPO2Low,
        PPN2Spike,
        SubOptimalDecoPPO2,
        InsufficientOCGas
    }

    [Serializable()]
	public class Warning
	{
        public string TypeString
        {
            get
            {
                string val = null;

                switch (this.Type)
                {
                    case WarningType.NotSet:
                        val = "NotSet";
                        break;
                    case WarningType.PPO2High:
                        val = "PPO2H";
                        break;
                    case WarningType.PPO2Low:
                        val = "PPO2L";
                        break;
                    case WarningType.PPN2Spike:
                        val = "PPN2";
                        break;
                    case WarningType.SubOptimalDecoPPO2:
                        val = "DECO";
                        break;
                }

                return val;
            }
        }

        public WarningType Type
        {
            get;
            set;
        }

        public string Description
        {
            get;
            set;
        }

        public override string ToString()
        {
            string text = this.Description;

            if (text == null)
            {
                text = this.Type.ToString();
            }

            return text;
        }
	}
}
